#ifndef __DTD__
#define __DTD__

#include <map>
#include <string>
#include "ElementDTD.h"

class DTD
{
	private:
		std::map<string, ElementDTD*> elems;
		std::vector<AttributeDTD*> atts;

	public:
		DTD();
		virtual ~DTD() {}

		/** 
		Add an element to the map of elements
            	@return 0 if the element was inserted
                   	-1 if the element couldn't be inserted
        	**/

		/**Add an element to a DTD */
		int addElement(char * name, ElementDTD * e);

		/**Add an attribute to a DTD */
		void addAttribute(AttributeDTD* att);

		/**
		Try to affect each attribute with the corresponding element.
		@return -1 if there is an error (e.g two attributes with the same 
			   name associated to the same element
               		0 if no error
		**/
		int makeDTD();
		/**Find out if an element exists according its name 
		@return NULL if the element does not exist
			The ElementDTD if it exists */
		ElementDTD* getElementByName(string name) const;

		/**Print the structure associate to ChoiceDTD*/
		virtual void display() const;
		
};


#endif
